<template>
    <!--报案审核任务页面 列表-->
    <div>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span style="line-height: 36px;">境外留学医疗保险---报案审核：</span>
            </div>
            <el-table :data="tableData3" border style="width: 100%" height="250">
                <el-table-column prop="REPORTINFORMATION_ID" label="报案号" width="200">
                </el-table-column>

                <el-table-column prop="REPORTINFORMATION_CAUSE" label="报案事由" width="300">
                </el-table-column>
                  <el-table-column prop="REPORTINFORMATION_TIME" label="报案时间" width="200"  :formatter="localDataFomatter">
                </el-table-column>
                  <el-table-column prop="REPORTINFORMATION_ADDPEOPLE" label="录入人员" width="200">
                </el-table-column>
                 <el-table-column prop="REPORTINFORMATION_TIME" label="录入时间" width="200" :formatter="localDataFomatter">
                </el-table-column>
                <el-table-column prop="PRODUCTNAME" label="产品名称" width="200">
                </el-table-column>
                <el-table-column prop="CUSTNAME" label="被保险人姓名" width="150">
                </el-table-column>

                <el-table-column label="操作" width="100">
                    <template scope="scope">
                        <el-button type="text" size="media" @click="gocheck(scope.row.REPORTINFORMATION_ID,scope.row.SALEDETAILNO)">
                            <i class="el-icon-view"> 审核</i>
                        </el-button>
                    </template>

                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination @current-change="handleCurrentChange" :current-page="currentPage1" :page-size="10" layout="total, prev, pager, next" :total="pagecount">
                </el-pagination>
            </div>
        </el-card>

    </div>
</template>

<script>
import getid from '@/js/getid'
export default {
    methods: {
        localDataFomatter(row, column, cellValue) {
      cellValue = cellValue + "Z";
      var data = new Date(cellValue);
      var dataString =
        data.getFullYear() +
        "/" +
        (data.getMonth() + 1 >= 10
          ? data.getMonth() + 1
          : "0" + (data.getMonth() + 1)) +
        "/" +
        (data.getDate() >= 10 ? data.getDate() : "0" + data.getDate()) +
        " " +
        (data.getHours() >= 10 ? data.getHours() : "0" + data.getHours()) +
        ":" +
        (data.getMinutes() >= 10 ? data.getMinutes() : "0" + data.getMinutes());
      return dataString;
    },
        handleCurrentChange(val) {
            this.currentPage = val;
            this.$http.get("ReportInfomation?state=审核&page=" + val - 1 + "&pagesum=10").then(response => {
                var data = response.body;
                if (data.code == 1) {
                    this.tableData3 = data.result;
                } else {
                    this.$notify.error({
                        title: '失败',
                        message: '数据获取失败'
                    });
                }
            }, response => {
                this.$notify.error({
                    title: '网络错误',
                    message: '网络错误'
                });
                this.loding = false;
            });
        },
        gocheck(id, sid) {
            // console.log(id+"  "+sid);
            this.$router.push({
                name: 'checkform',
                query: {
                    id: id,
                    sid: sid
                }
            });
        }
    },
    activated() {
        this.$http.get("ReportInfomation?state=审核&page=0&pagesum=10").then(response => {
            var data = response.body;
            if (data.code == 1) {
                this.tableData3 = data.result;
                this.pagecount = data.pagecount;
            } else {
                this.$notify.error({
                    title: '失败',
                    message: '数据获取失败'
                });
            }
        }, response => {
            this.$notify.error({
                title: '网络错误',
                message: '网络错误'
            });
            this.loding = false;
        });
    },
    data() {
        return {
            pagecount: 0,
            formInline: {
                user: '',
                region: ''
            },
            currentPage1: 1,
            tableData3: []
        }
    }
}
</script>
<style>
.gutter {
    position: absolute !important;
    right: 0;
}

table {
    text-align: center;
}

.cell {
    text-align: center;
}
</style>